<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>title</title>
</head>
<body>
    <script>
        var arr =[1,2,3,4,2,5,6,2,7,2];
        console.log(arr);
        var newArr = arr.filter(function(item,index){
            return arr.indexOf(item) === index;
        });
        console.log('需求分析1题计算结果: ' + newArr);

        
        var array = [4,6,0,3,0,0,0,1,3];
        console.log(array);
        var newArray = array.filter(function(item,index){
            return array.indexOf(item) === index;
        });
        console.log('需求分析2题计算结果: ' + newArray);
    </script>
</body>
</html>